﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Member_HoaDonDetails : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["btnDetails"] != null && Request.QueryString["idHoaDon"] != null)
        {
            int idHoaDon = Int16.Parse(Request["idHoaDon"]);
            List<DTO.ChiTietHoaDonDto> lstChiTietHoaDon = BUS.ChiTietHoaDonBus.LayChiTietHoaDonTheoIDHoaDon(idHoaDon);
            lblDetailsContent.Text = "<table align='center' border='1' cellpadding='4' cellspacing='0'><tr><td class='giohang_Header'>STT</td><td class='giohang_Header'>Mã hóa đơn</td><td class='giohang_Header'>Tên Sản phẩm</td><td class='giohang_Header'>Số lượng</td></tr>";
            DTO.SanPhamDto sanpham = new DTO.SanPhamDto();
            int j;
            for (int i = 0; i < lstChiTietHoaDon.Count; i++)
            {
                j = i + 1;
                sanpham = BUS.SanPhamBus.LaySanPhamTheoID(lstChiTietHoaDon[i].IDSanPham);
                lblDetailsContent.Text += "<tr><td>" + j + "</td><td>" + lstChiTietHoaDon[i].IDHoaDon + "</td><td>" + sanpham.TenSanPham + "</td><td>" + lstChiTietHoaDon[i].SoLuong + "</td></tr>";
            }
            lblDetailsContent.Text += ("</table>");
        }
    }
    protected void btnDefault_Click(object sender, EventArgs e)
    {
        Response.Redirect("../Default.aspx");
    }
    protected void btnPrevious_Click(object sender, EventArgs e)
    {
        Response.Redirect("QuanLyDonHang.aspx");
    }
}
